from apps.a_common.constants import CheckListStatus, CheckListType
from apps.a_common.db import TimeMarkModel
from apps.foundation import db
from utils.time import int_timestamp


class CheckList(TimeMarkModel):
    name = db.Column(db.VARCHAR(126))
    start_at = db.Column(db.Integer, default=int_timestamp)
    end_at = db.Column(db.Integer, nullable=True)
    status = db.Column(db.SMALLINT, default=CheckListStatus.NOT_ASSIGNED)
    type = db.Column(db.SMALLINT, default=CheckListType.TODO)
    process_id = db.Column(db.Integer)
    user_id = db.Column(db.Integer, nullable=True)